// pages/user/index.js
Page({

  data: {
    userInfo: {},
    // 收藏的商品数量
    collectNum: 0
  },

  onShow: function (options) {
    const userInfo = wx.getStorageSync("userinfo");
    const collect = wx.getStorageSync("collect");

    this.setData({
      userInfo,
      collectNum: collect.length
    })
  },

})